﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LojaVirtual.Comuns.Helpers
{
    public static class CustomComparer
    {
        public static Boolean CompareString(String value, String toCompare)
        {
            value = value.ToUpper();
            toCompare = toCompare.ToUpper();

            return value.Contains(toCompare);
        }

        public static Boolean CompareString(IEnumerable<string> values, String toCompare)
        {
            toCompare = toCompare.ToUpper();
            Boolean found = false;
            foreach (var value in values)
            {
                if (value.ToUpper().Contains(toCompare))
                {
                    found = true;
                    break;
                }
            }

            return found;
        }
    }
}
